{
 "cells": [
  {
   "cell_type": "markdown",
   "id": "6989c199",
   "metadata": {},
   "source": [
    "## 多分类问题简单回顾"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "5700f99d",
   "metadata": {},
   "source": [
    "在二分类问题中，我们可以使用sigmoid函数。而在多分类问题中，我们希望将输入数据划分到超过两个类别中的一个。这种情况下，我们通常使用一种叫做 \"softmax\" 的函数。\n",
    "\n",
    "我们将神经网络的最后一层称为 \"softmax层\"。这一层的输出是一个概率分布，表示输入数据属于每个类别的概率。为了计算这些概率，我们使用 softmax 函数。\n",
    "\n",
    "让我们假设有 K 个类别，其中第 k 个类别的概率为 $p_k$。我们将最后一层的输出（即 logits）记为 $z_1，z_2，…，z_k$。那么根据 softmax 函数的定义，每个类别的概率可以计算为：\n",
    "\n",
    "$$ p_k = \\frac{exp(z_k)}{\\sum_{i=1}^{k} exp(z_i)} $$\n",
    "\n",
    "这个过程是对所有 K 个 logits 应用指数函数，然后将它们归一化为概率分布。\n",
    "\n",
    "在训练神经网络时，我们通常使用交叉熵损失函数来度量预测值与真实值之间的差距。对于多分类问题，交叉熵损失函数可以计算为：\n",
    "\n",
    "$$ L = - \\sum_{i=1}^{k} y_i \\times log(p_i) $$\n",
    "\n",
    "其中 $y_i$ 是真实值，$p_i$ 是预测值。\n",
    "\n",
    "通过最小化交叉熵损失函数，我们可以训练出模型的参数。当我们训练完神经网络后，我们就可以使用它来进行多分类。为了做出预测，我们需要将输入数据输入到神经网络中，并根据输出的概率分布来决定它属于哪个类别。\n",
    "\n",
    "使用 softmax 函数和交叉熵损失函数是一种多分类的常见的方法。"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "8da7e167",
   "metadata": {},
   "source": [
    "## 代码实现"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "a4832b22",
   "metadata": {},
   "source": [
    "### 加载MNIST数据集"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 1,
   "id": "2426650f",
   "metadata": {},
   "outputs": [],
   "source": [
    "import torch\n",
    "import torchvision"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 2,
   "id": "1dfa55b5",
   "metadata": {},
   "outputs": [],
   "source": [
    "transformation = torchvision.transforms.ToTensor()\n",
    "train_dataset = torchvision.datasets.MNIST(root='data/mnist', train=True, download=True, transform=transformation)\n",
    "test_dataset = torchvision.datasets.MNIST(root='data/mnist', train=False, download=True, transform=transformation)"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "ea174b24",
   "metadata": {},
   "source": [
    "### 数据加载器"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 3,
   "id": "21bd73b6",
   "metadata": {},
   "outputs": [],
   "source": [
    "batch_size = 64\n",
    "train_dataloader = torch.utils.data.DataLoader(train_dataset, batch_size=batch_size, shuffle=True)\n",
    "test_dataloader = torch.utils.data.DataLoader(test_dataset, batch_size=batch_size, shuffle=False)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 4,
   "id": "fa1043f7",
   "metadata": {},
   "outputs": [],
   "source": [
    "import matplotlib.pyplot as plt"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 5,
   "id": "7b7fe947",
   "metadata": {
    "scrolled": true
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "torch.Size([64, 1, 28, 28]) torch.Size([64])\n"
     ]
    },
    {
     "data": {
      "image/png": "iVBORw0KGgoAAAANSUhEUgAAAPsAAAD4CAYAAAAq5pAIAAAAOXRFWHRTb2Z0d2FyZQBNYXRwbG90bGliIHZlcnNpb24zLjQuMCwgaHR0cHM6Ly9tYXRwbG90bGliLm9yZy8+yak3AAAACXBIWXMAAAsTAAALEwEAmpwYAAANT0lEQVR4nO3db6wV9Z3H8c9Hl8YATQTUG6RkQeKTusna9QY3iqZGW10fiD6QlOgGDVkaUzdtQuIafVBiYkI22xZ5goFggE3XpqFVeNDsFhGjfUARCIugFl0CKQTBxgQkxqDw3Qd3MLd6z+/ce2bOH/m+X8nNOWe+Z2a+mfBh5sycMz9HhABc+i7rdw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oAAAAASUVORK5CYII=\n",
      "text/plain": [
       "<Figure size 432x288 with 1 Axes>"
      ]
     },
     "metadata": {
      "needs_background": "light"
     },
     "output_type": "display_data"
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "tensor(9)\n",
      "torch.Size([64, 1, 28, 28]) torch.Size([64])\n"
     ]
    },
    {
     "data": {
      "image/png": "iVBORw0KGgoAAAANSUhEUgAAAPsAAAD4CAYAAAAq5pAIAAAAOXRFWHRTb2Z0d2FyZQBNYXRwbG90bGliIHZlcnNpb24zLjQuMCwgaHR0cHM6Ly9tYXRwbG90bGliLm9yZy8+yak3AAAACXBIWXMAAAsTAAALEwEAmpwYAAALuUlEQVR4nO3dQcgc9R3G8eep1Yt6SCoNIabVSi5SaCwhFBrqG0RJc4lexBxKSoXXQwWFHhrs4c1LKUip9ii8YjAtVhHUGqRU0/AmaS+SV0ljYqpJJWLCa14kB+PJqr8ediJv4u7O687Mzrz5fT+w7O5/dmd+Gd4nMzv/mfk7IgTgyveNtgsAMB6EHUiCsANJEHYgCcIOJPHNcS7MNof+gYZFhPu1V9qy295i+x3bp2zvrDIvAM3yqP3stq+S9K6kOyWdkXRY0vaIeHvId9iyAw1rYsu+UdKpiHgvIj6V9JykbRXmB6BBVcK+RtIHi96fKdouYXvS9pztuQrLAlBR4wfoImJG0ozEbjzQpipb9rOS1i56f2PRBqCDqoT9sKR1tm+2fY2k+yTtracsAHUbeTc+Ij6z/aCkVyVdJWl3RByvrTIAtRq5622khfGbHWhcIyfVAFg+CDuQBGEHkiDsQBKEHUiCsANJEHYgCcIOJEHYgSQIO5AEYQeSIOxAEoQdSIKwA0kQdiAJwg4kQdiBJAg7kARhB5Ig7EAShB1IYqxDNmP8JiYmhk6fmpqq9P0DBw4MnT49PT3yd1EvtuxAEoQdSIKwA0kQdiAJwg4kQdiBJAg7kASjuF4BZmdnB04r6ydv0+bNm4dOpx9+NINGca10Uo3t05IuSPpc0mcRsaHK/AA0p44z6DZHxEc1zAdAg/j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g4kQdiBJAg7kARhB5Ig7EAShB1I4v+v7QGrmv5erwAAAABJRU5ErkJggg==\n",
      "text/plain": [
       "<Figure size 432x288 with 1 Axes>"
      ]
     },
     "metadata": {
      "needs_background": "light"
     },
     "output_type": "display_data"
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "tensor(2)\n",
      "torch.Size([64, 1, 28, 28]) torch.Size([64])\n"
     ]
    },
    {
     "data": {
      "image/png": "iVBORw0KGgoAAAANSUhEUgAAAPsAAAD4CAYAAAAq5pAIAAAAOXRFWHRTb2Z0d2FyZQBNYXRwbG90bGliIHZlcnNpb24zLjQuMCwgaHR0cHM6Ly9tYXRwbG90bGliLm9yZy8+yak3AAAACXBIWXMAAAsTAAALEwEAmpwYAAANLElEQVR4nO3db6hc9Z3H8c8nmoLaiNGLIdiwaUseGBfW6FU0ldWltGhEYp+UXkSzrHiLVGxhH2yIYJUloIvtsuRB5RalN9K1VLQYSqV1Q920KMUbiRqTbc2GaPPfGLEmPujq/fbBnHSv5s45NzPnzJnk+37BZWbOd2bOl0M+Of/mnJ8jQgDOfPPabgDAYBB2IAnCDiRB2IEkCDuQxNmDnJltDv0DDYsIzza9rzW77Rtt/972Lttr+/kuAM1yr+fZbZ8l6Q+SviJpr6SXJY1FxI6Sz7BmBxrWxJr9akm7ImJ3RPxZ0k8kre7j+wA0qJ+wXyLpjzNe7y2mfYLtcdtTtqf6mBeAPjV+gC4iJiRNSGzGA23qZ82+T9KSGa8/V0wDMIT6CfvLkpbZ/rztz0j6hqRN9bQFoG49b8ZHxEe275H0S0lnSXo8It6orTMAter51FtPM2OfHWhcIz+qAXD6IOxAEoQdSIKwA0kQdiAJwg4kQdiBJAg7kARhB5Ig7EAShB1IgrADSRB2IAnCDiRB2IEkCDuQBGEHkiDsQBKEHUiCsANJEHYgCcIOJEHYgSQIO5AEYQeSIOxAEoQdSIKwA0kQdiCJnodsBiRpbGystL5ixYqev/vRRx8tre/evbvn786or7Db3iPpA0kfS/ooIkbraAp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hT6GXkRskXT0U5NXS5osnk+q849l4Lr0NhQi4kBEvFI8/0DSiWHGW112JX0NRBthv0TSH2e83qvhGu89JP3K9lbb4203M4tFM4bZOihpUZvNzKJyGO9B+tQw40Oz7HoZ/rxfHKA72XURcYWkmyR9q9hcHUrR2QcbpnOnP5D0RXXGADwg6XttNlMMM/60pO9ExJ9m1tpcdrP0NZDl1kbY90laMuP154ppQyEi9hWPhyX9TJ3djmFy6MQIusXj4Zb7+auIOBQRH0fEtKQfqsVlVwwz/rSkH0fEM8Xk1pfdbH0Narm1EfaXJS2z/Xnbn5H0DUmbWujjJLbPKw6cyPZ5kr6q4RuKepOkNcXzNZKebbGXTxiWYby7DTOulpdd68OfR8TA/yStUueI/P9Kuq+NHrr09QVJrxZ/b7Tdm6Qn1dms+z91jm3cKekiSZslvSnpvyRdOES9PaHO0N6vqROsxS31dp06m+ivSdpW/K1qe9mV9DWQ5cbPZYEkOEAHJEHYgSQIO5AEYQeSIOxAEoQdSIKwA0n8BeVKH9ZkyWA7AAAAAElFTkSuQmCC\n",
      "text/plain": [
       "<Figure size 432x288 with 1 Axes>"
      ]
     },
     "metadata": {
      "needs_background": "light"
     },
     "output_type": "display_data"
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "tensor(4)\n",
      "torch.Size([64, 1, 28, 28]) torch.Size([64])\n"
     ]
    },
    {
     "data": {
      "image/png": "iVBORw0KGgoAAAANSUhEUgAAAPsAAAD4CAYAAAAq5pAIAAAAOXRFWHRTb2Z0d2FyZQBNYXRwbG90bGliIHZlcnNpb24zLjQuMCwgaHR0cHM6Ly9tYXRwbG90bGliLm9yZy8+yak3AAAACXBIWXMAAAsTAAALEwEAmpwYAAANCElEQVR4nO3dYahc9ZnH8d9vYxLBRkmqXq4mrLGIUISmGoKwKllKa9Y3MS8szYsly8a9fVGhlRVWXKTCsiCy7bKvCreoTdeaEjQxIcRt3VDW1RfRG4kmxk10Q2ISY6JE1CCaTfLsi3si13jnzL1zzpkzuc/3A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5O5pW9FiM70LBKh/F1IexA83o+jAcwMxB2IAnCDiRB2IEkCDuQBGEHkiDsQBKEHUiCsANJEHYgCcIOJEHYgSQIO5AEYQeS6PeUzR9KOjTh8ZXFskE0qL0Nal8SvfWqzt7+vFOhr99n/9rG7bGIWNpaAyUGtbdB7Uuit171qzcO44EkCDuQRNthH215+2UGtbdB7Uuit171pbdW37MD6J+2R3YAfULYgSRaCbvtFbb32X7H9oNt9NCJ7YO2d9ve1fb8dMUceids75mwbIHtF2y/XdxOOsdeS709Yvtose922b6rpd4W2f6T7b2237T902J5q/uupK++7Le+v2e3PUvSfknfl3RE0quSVkfE3r420oHtg5KWRkTrH8CwfYekU5J+e35qLduPSToZEY8W/1HOj4h/GJDeHtE0p/FuqLdO04z/jVrcd3VOf96LNkb2ZZLeiYgDEXFa0u8lrWyhj4EXES9KOnnB4pWS1hX312n8H0vfdehtIETEsYh4rbj/qaTz04y3uu9K+uqLNsJ+raTDEx4f0WDN9x6S/mh7p+2RtpuZxNCEabbelzTUZjOT6DqNdz9dMM34wOy7XqY/r4oTdF93W0TcLOmvJP2kOFwdSDH+HmyQrp3+StK3ND4H4DFJv2izmWKa8Wcl/SwiPplYa3PfTdJXX/ZbG2E/KmnRhMcLi2UDISKOFrcnJG3S+NuOQXL8/Ay6xe2Jlvv5UkQcj4izEXFO0q/V4r4rphl/VtLvImJjsbj1fTdZX/3ab22E/VVJN9hebHuOpB9J2tJCH19j+7LixIlsXybpBxq8qai3SFpT3F8jaXOLvXzFoEzj3WmacbW871qf/jwi+v4n6S6Nn5H/X0n/2EYPHfq6XtLrxd+bbfcmab3GD+v+T+PnNtZK+qak7ZLelvSfkhYMUG//rvGpvd/QeLCGW+rtNo0for8haVfxd1fb+66kr77sNz4uCyTBCTogCcIOJEHYgSQIO5AEYQeSIOxAEoQdSOL/ASO0+KcdzfHhAAAAAElFTkSuQmCC\n",
      "text/plain": [
       "<Figure size 432x288 with 1 Axes>"
      ]
     },
     "metadata": {
      "needs_background": "light"
     },
     "output_type": "display_data"
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "tensor(4)\n",
      "torch.Size([64, 1, 28, 28]) torch.Size([64])\n"
     ]
    },
    {
     "data": {
      "image/png": "iVBORw0KGgoAAAANSUhEUgAAAPsAAAD4CAYAAAAq5pAIAAAAOXRFWHRTb2Z0d2FyZQBNYXRwbG90bGliIHZlcnNpb24zLjQuMCwgaHR0cHM6Ly9tYXRwbG90bGliLm9yZy8+yak3AAAACXBIWXMAAAsTAAALEwEAmpwYAAANYklEQVR4nO3df6hc9ZnH8c9HjRFi/khWNgQrmzSKEAqbSgjqyupaGqKgMSglEZeUDVzBKo34Y8X9o6KURFm7BJGaW6LNrl1LNRZjWWjdpDauSjWJWY26UTcoTbjmIkZMUejGPPvHHOVW7/nOdebMD/O8X3CZmfPcM+fhcD/3nDk/5uuIEIDj3wmDbgBAfxB2IAnCDiRB2IEkCDuQxEn9XJhtDv0DPRYRnmx6V1t228ts77P9lu3bunkvAL3lTs+z2z5R0huSvi3pgKQXJa2KiNcK87BlB3qsF1v2JZLeioj9EfEnST+XtLyL9wPQQ92E/XRJf5jw+kA17c/YHrG90/bOLpYFoEs9P0AXEaOSRiV244FB6mbLflDSGRNef62aBmAIdRP2FyWdZXu+7ZMlrZS0tZm2ADSt4934iDhq+3pJv5Z0oqQHI+LVxjoD0KiOT711tDA+swM915OLagB8dRB2IAnCDiRB2IEkCDuQBGEHkiDsQBKEHUiCsANJEHYgCcIOJEHYgSQIO5AEYQeSIOxAEoQdSIKwA0kQdiAJwg4kQdiBJAg7kERfh2xGZ+xJvyz0M2vWrKmtXXnllcV5ly1bVqwfPny4WH/00UeL9VtuuaW29uGHHxbnRbPYsgNJEHYgCcIOJEHYgSQIO5AEYQeSIOxAEozi+hVw5513Fuu33357bW3Lli3FecfHx4v12bNnF+uXX355sf7ss8/W1i655JLivP382zye1I3i2tVFNbbflnRE0ieSjkbE4m7eD0DvNHEF3d9FxHsNvA+AHuIzO5BEt2EP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QdVfoqy8GEfbTJf1hwusDGq7x3kPSb2zvsj0y6GYmMWfCMFvvSpozyGYm0XYY73763DDjQ7PuOhn+vFscoPuiCyLiHEmXSPpetbs6lKL1GWyYzp3+WNICtcYAHJN07yCbqYYZ3yJpbUR8OLE2yHU3SV99WW+DCPtBSWdMeP21atpQiIiD1eO4pF+q9bFjmBz6dATd6nF8wP18JiIORcQnEXFM0k80wHVXDTO+RdLPIuLxavLA191kffVrvQ0i7C9KOsv2fNsnS1opaesA+vgC2zOqAyeyPUPSUg3fUNRbJa2unq+W9MQAe/kzwzKMd90w4xrwuhv48OcR0fcfSZeqdUT+fyX90yB6qOnr65L+u/p5ddC9SXpErd26/1Pr2MYaSX8haZukNyX9p6TZQ9Tbv6k1tPfLagVr7oB6u0CtXfSXJe2pfi4d9Lor9NWX9cblskASHKADkiDsQBKEHUiCsANJEHYgCcIOJEHYgST+H7R9Q1Yw8BbrAAAAAElFTkSuQmCC\n",
      "text/plain": [
       "<Figure size 432x288 with 1 Axes>"
      ]
     },
     "metadata": {
      "needs_background": "light"
     },
     "output_type": "display_data"
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "tensor(3)\n",
      "torch.Size([64, 1, 28, 28]) torch.Size([64])\n"
     ]
    },
    {
     "data": {
      "image/png": "iVBORw0KGgoAAAANSUhEUgAAAPsAAAD4CAYAAAAq5pAIAAAAOXRFWHRTb2Z0d2FyZQBNYXRwbG90bGliIHZlcnNpb24zLjQuMCwgaHR0cHM6Ly9tYXRwbG90bGliLm9yZy8+yak3AAAACXBIWXMAAAsTAAALEwEAmpwYAAANZUlEQVR4nO3db6xU9Z3H8c9ngaqhjcHq4uXPbrHqg6aJdnPFJqumphZYDUKfIIRUapq9TUTTak00qKlPTJp1bbNPJLkNWmoqpEmr8qBZi6QJbGLwoqIgplUIpsIFbIzBGqSLfPvgHpsr3vnNZc78g+/7ldzMzPnOOeeb0Q/nzPnNzM8RIQBnv3/qdQMAuoOwA0kQdiAJwg4kQdiBJ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ElFTkSuQmCC\n",
      "text/plain": [
       "<Figure size 432x288 with 1 Axes>"
      ]
     },
     "metadata": {
      "needs_background": "light"
     },
     "output_type": "display_data"
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "tensor(3)\n",
      "torch.Size([64, 1, 28, 28]) torch.Size([64])\n"
     ]
    },
    {
     "data": {
      "image/png": "iVBORw0KGgoAAAANSUhEUgAAAPsAAAD4CAYAAAAq5pAIAAAAOXRFWHRTb2Z0d2FyZQBNYXRwbG90bGliIHZlcnNpb24zLjQuMCwgaHR0cHM6Ly9tYXRwbG90bGliLm9yZy8+yak3AAAACXBIWXMAAAsTAAALEwEAmpwYAAAORElEQVR4nO3df4xV9ZnH8c8jBU1oVZAwQeouLKhJs/5Aidm4qJgGFBODNUFK4mZWm4zRuoFosoU2pmpTIbruGv8hTIXArtVaBbamrtsKNusak4ZhRMRBqhJMQRyCmBTU2EWe/WMOzYhzv2fmnnPuufC8X8lk7j3PnHOeXP1wzj3fc+/X3F0ATn2n1d0AgNYg7EAQhB0IgrADQRB2IIivtXJnZsalf6Bi7m5DLS90ZDez681sl5m9a2ZLi2wLQLWs2XF2Mxsl6Q+S5kjaK2mLpEXu3pdYhyM7ULEqjuxXSHrX3Xe7+58l/ULS/ALbA1ChImGfLOmPg57vzZZ9iZl1mVmPmfUU2BeAgiq/QOfu3ZK6JU7jgToVObLvk3TeoOffzJYBaENFwr5F0vlmNtXMxkj6rqTny2kLQNmaPo1396Nmdrek30gaJWmNu79VWmcAStX00FtTO+M9O1C5Sm6qAXDyIOxAEIQdCIKwA0EQdiAIwg4EQdiBIAg7EARhB4Ig7EAQhB0IgrADQRB2IAjCDgRB2IEgCDsQBGEHgiDsQBCEHQiCsANBEHYgCMIOBEHYgSAIOxAEYQeCIOxAEIQdCIKwA0EQdiAIwg4E0fT87JJkZnskHZb0haSj7j6zjKYAlK9Q2DPXuvvBErYDoEKcxgNBFA27S/qtmW01s66h/sDMusysx8x6Cu4LQAHm7s2vbDbZ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IOxAEYQeCyP3CyZIdlPT+oOcTsmXtqF17a9e+JHprVpm9/XWjQks/z/6VnZv1uPvM2hpIaNfe2rUvid6a1areOI0HgiDsQBB1h7275v2ntGtv7dqXRG/Naklvtb5nB9A6dR/ZAbQIYQeCqCXsZna9me0ys3fNbGkdPTRiZnvM7M1sGupa56fL5tA7YGY7Bi0bb2Yvmdk72e8h59irqbe2mMY7Mc14ra9d3dOft/w9u5mNkvQHSXMk7ZW0RdIid+9raSMNmNkeSTPdvfYbMMzsaklHJP378am1zOxhSYfcfUX2D+U4d/9Bm/R2v0Y4jXdFvTWaZvwfVeNrV+b0582o48h+haR33X23u/9Z0i8kza+hj7bn7q9IOnTC4vmS1mWP12ngf5aWa9BbW3D3/e7emz0+LOn4NOO1vnaJvlqijrBPlvTHQc/3qr3me3dJvzWzrWbWVXczQ+gYNM3Wh5I66mxmCLnTeLfSCdOMt81r18z050Vxge6rZrn7ZZLmSfp+drralnzgPVg7jZ2ulDRNA3MA7pf0aJ3NZNOMr5e0xN3/NLhW52s3RF8ted3qCPs+SecNev7NbFlbcPd92e8DkjZq4G1HO+k/PoNu9vtAzf38hbv3u/sX7n5M0s9U42uXTTO+XtLP3X1Dtrj2126ovlr1utUR9i2SzjezqWY2RtJ3JT1fQx9fYWZjswsnMrOxkuaq/aaifl5SZ/a4U9KvauzlS9plGu9G04yr5teu9unP3b3lP5Ju0MAV+fck/aiOHhr09TeS3sh+3qq7N0lPa+C07v80cG3je5LOkbRZ0juSNkka30a9/YcGpvberoFgTaqpt1kaOEXfLmlb9nND3a9doq+WvG7cLgsEwQU6IAjCDgRB2IEgCDsQBGEHgiDsQBCEHQji/wE4KYvSIf4/JAAAAABJRU5ErkJggg==\n",
      "text/plain": [
       "<Figure size 432x288 with 1 Axes>"
      ]
     },
     "metadata": {
      "needs_background": "light"
     },
     "output_type": "display_data"
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "tensor(0)\n",
      "torch.Size([64, 1, 28, 28]) torch.Size([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Wy0pD9L+p6kPZJelrTY3Xe2tZEcZrZL0hx3r/0DGGZ2iaRDktYcGVrLzP5N0kF3vzP7QznF3X/aIb3dquMcxrui3vKGGf+Banzvyhz+vBV1bNnPk/S2u7/r7n+VtFbS/Br66Hju/qykg8dMni9pdfZ4tRr/Wdoup7eO4O773P2V7PGnko4MM17re5foqy3qCPsZknYPeb5HnTXeu0v6nZn1mVlP3c0Mo2vIMFsfSuqqs5lhNB3Gu52OGWa8Y967VoY/L4oTdF93sbv/g6S5kn6c7a52JG8cg3XStdOfS/qOGmMA7pN0V53NZMOMPyppqbv/ZWitzvdumL7a8r7VEfa9kqYPeT4tm9YR3H1v9rtf0no1Djs6yf4jI+hmv/tr7ucr7r7f3Qfd/bCkX6jG9y4bZvxRSb9298eyybW/d8P11a73rY6wvyzpbDP7lpmNlbRI0sYa+vgaMxuXnTiRmY2T9H113lDUGyVdnT2+WtKGGns5SqcM4503zLhqfu9qH/7c3dv+I2meGmfk35H0szp6yOnr25L+N/t5ve7eJD2kxm7dl2qc2/ihpFMlbZH0lqTfS5raQb39lxpDe7+qRrC6a+rtYjV20V+VtD37mVf3e5foqy3vGx+XBYLgBB0QBGEHgiDsQBCEHQiCsANBEHYgCMIOBPH/NilgsTK7FosAAAAASUVORK5CYII=\n",
      "text/plain": [
       "<Figure size 432x288 with 1 Axes>"
      ]
     },
     "metadata": {
      "needs_background": "light"
     },
     "output_type": "display_data"
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "tensor(2)\n",
      "torch.Size([64, 1, 28, 28]) torch.Size([64])\n"
     ]
    },
    {
     "data": {
      "image/png": "iVBORw0KGgoAAAANSUhEUgAAAPsAAAD4CAYAAAAq5pAIAAAAOXRFWHRTb2Z0d2FyZQBNYXRwbG90bGliIHZlcnNpb24zLjQuMCwgaHR0cHM6Ly9tYXRwbG90bGliLm9yZy8+yak3AAAACXBIWXMAAAsTAAALEwEAmpwYAAANg0lEQVR4nO3dYaxU9ZnH8d9vWSpEGwVxb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7fMl/UjDNxX1c5LWVPfXSNreYC9fMizTeLebZlwNv3eNT38eEQP/kbRCk5/Ivy3p35rooU1ffy3p/6qf15ruTdJTmjys+0KTn23cIeliSTslHZL0kqS5Q9Tbf2pyau/9mgzW/IZ6u0GTh+j7Je2rflY0/d4V+hrI+8bXZYEk+IAOSIKwA0kQdiAJwg4kQdiBJAg7kARhB5L4f0UsRh9Ptu85AAAAAElFTkSuQmCC\n",
      "text/plain": [
       "<Figure size 432x288 with 1 Axes>"
      ]
     },
     "metadata": {
      "needs_background": "light"
     },
     "output_type": "display_data"
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "tensor(5)\n",
      "torch.Size([64, 1, 28, 28]) torch.Size([64])\n"
     ]
    },
    {
     "data": {
      "image/png": "iVBORw0KGgoAAAANSUhEUgAAAPsAAAD4CAYAAAAq5pAIAAAAOXRFWHRTb2Z0d2FyZQBNYXRwbG90bGliIHZlcnNpb24zLjQuMCwgaHR0cHM6Ly9tYXRwbG90bGliLm9yZy8+yak3AAAACXBIWXMAAAsTAAALEwEAmpwYAAANa0lEQVR4nO3df+hVdZ7H8dcrf0SooW5lXx1ZJ/spG2VILGwsxTDSRmBFP8Y/FmMFKzRmYoliFhxhW5JlZxaCELRMi1mngYpkGnbGbNLdfySTLPsxUxvGKP4ohGz+8td7//geh6/2Ped+vfece+74fj7gy733vO+5593FV+fc8+vjiBCA898FbTcAoD8IO5AEYQeSIOxAEoQdSGJ8Pxdmm13/QMMiwqNN72nNbvt227+3/ZntJ3v5LADNcrfH2W2Pk/QHSd+XtE/SO5IWR8RHFfOwZgca1sSa/WZJn0XE5xFxTNIvJC3q4fMANKiXsM+S9McRr/cV085ge5ntnbZ39rAsAD1qfAddRKyVtFZiMx5oUy9r9v2SZo94/Z1iGoAB1EvY35F0le3v2p4o6QeSNtfTFoC6db0ZHxEnbK+Q9BtJ4yStj4gPa+sMQK26PvTW1cL4zQ40rpGTagD85SDsQBKEHUiCsANJEHYgCcIOJEHYgSQI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SvXWrL721+psdQP+0vWYH0CeEHUiilbDbvt32721/ZvvJNnooY3uv7Q+KYahbHZ+uGEPvsO09I6ZNt73F9qfF46hj7LXU20AM410xzHir313bw5/3/Te77XGS/iDp+5L2SXpH0uKI+KivjZSwvVfSgoho/QQM238v6U+SXjw9tJbtf5d0JCJWF/+jnBYRTwxIb6t0jsN4N9Rb2TDjD6rF767O4c+70caa/WZJn0XE5xFxTNIvJC1qoY+BFxHbJR05a/IiSRuL5xs1/I+l70p6GwgRcSAidhXPv5F0epjxVr+7ir76oo2wz5L0xxGv92mwxnsPSb+1/a7tZW03M4oZI4bZOihpRpvNjKLjMN79dNYw4wPz3XUz/Hmv2EH3bbdExE2S/kHS8mJzdSDF8G+wQTp2ukbSXA2PAXhA0k/bbKYYZvwVST+KiKMja21+d6P01ZfvrY2w75c0e8Tr7xTTBkJE7C8eD0t6TcM/OwbJodMj6BaPh1vu588i4lBEnIyIU5LWqcXvrhhm/BVJP4+IV4vJrX93o/XVr++tjbC/I+kq29+1PVHSDyRtbqGPb7E9qdhxItuTJC3U4A1FvVnSkuL5Ekmvt9jLGQZlGO+yYcbV8nfX+vDnEdH3P0l3aHiP/P9J+pc2eijp6wpJu4u/D9vuTdImDW/WHdfwvo2lkv5K0lZJn0p6U9L0AertJQ0P7f2+hoM11FJvt2h4E/19Se8Vf3e0/d1V9NWX743TZYEk2EEHJEHYgSQIO5AEYQeSIOxAEoQdSIKwA0n8PyOoGcDtdAaLAAAAAElFTkSuQmCC\n",
      "text/plain": [
       "<Figure size 432x288 with 1 Axes>"
      ]
     },
     "metadata": {
      "needs_background": "light"
     },
     "output_type": "display_data"
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "tensor(2)\n",
      "torch.Size([64, 1, 28, 28]) torch.Size([64])\n"
     ]
    },
    {
     "data": {
      "image/png": "iVBORw0KGgoAAAANSUhEUgAAAPsAAAD4CAYAAAAq5pAIAAAAOXRFWHRTb2Z0d2FyZQBNYXRwbG90bGliIHZlc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82MY9kv5B0m5Jb0j6X0mXD1Fv/63xob1f0Xiw5rbU2zKN76K/IulAdVve9ror9DWQ9cblskASHKADkiDsQBKEHUiCsANJEHYgCcIOJEHYgST+HzNz+dNO1p+mAAAAAElFTkSuQmCC\n",
      "text/plain": [
       "<Figure size 432x288 with 1 Axes>"
      ]
     },
     "metadata": {
      "needs_background": "light"
     },
     "output_type": "display_data"
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "tensor(3)\n",
      "torch.Size([64, 1, 28, 28]) torch.Size([64])\n"
     ]
    },
    {
     "data": {
      "image/png": "iVBORw0KGgoAAAANSUhEUgAAAPsAAAD4CAYAAAAq5pAIAAAAOXRFWHRTb2Z0d2FyZQBNYXRwbG90bGliIHZlcnNpb24zLjQuMCwgaHR0cHM6Ly9tYXRwbG90bGliLm9yZy8+yak3AAAACXBIWXMAAAsTAAALEwEAmpwYAAAMrklEQVR4nO3dXawV9bnH8d9PTvECagS1OztAX6zGWI85tCIec0z10BQ93EBvTLk4WiVuY2pTk0YlNrHe+JJz+pLGC8xuakpPemyq1OpF0xYJgdMYX7YGBDEgJRggCLWYAFdUfM7FHs0urDVru2bWmoHn+0l21lrzrFnzZMKPmTWzZv6OCAE4+53TdAMAhoOwA0kQdiAJwg4kQdiBJP5pmAuzzaF/YMAiwp2mV9qy277J9k7bu22vrvJZAAbL/Z5ntz1D0i5JX5e0X9KrklZGxI6SediyAwM2iC37Ykm7I2JPRJyQ9GtJyyt8HoABqhL2eZL2TXm9v5j2D2yP2Z6wPVFhWQAqGvgBuogYlzQusRsPNKnKlv2ApAVTXs8vpgFooSphf1XSpba/YHumpG9Ker6etgDUre/d+Ij4wPbdkv4oaYakJyPizdo6A1Crvk+99bUwvrMDAzeQH9UAOHMQdiAJwg4kQdiBJAg7kARhB5Ig7EAShB1IgrADSRB2IAnCDiRB2IEkCDuQBGEHkiDsQBKEHUiCsANJEHYgCcIOJEHYgSQIO5AEYQeSIOxAEoQdSIKwA0kQdiAJwg4kQ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fbReRGyWdOSUycslrS2er9XkP5ah69JbK0TEwYh4vXh+TNJHw4w3uu5K+hqKJsI+T9K+Ka/3q13jvYekP9l+zfZY0810MDJlmK13JY002UwHPYfxHqZThhlvzbrrZ/jzqjhAd7rrIuIrkv5D0reL3dVWisnvYG06dzqtYbyHpcMw4x9rct31O/x5VU2E/YCkBVNezy+mtUJEHCgeD0t6Vu0bivrQRyPoFo+HG+7nY20axrvTMONqwbprcvjzJsL+qqRLbX/B9kxJ35T0fAN9nMb2rOLAiWzPkrRU7RuK+nlJtxbPb5X0XIO9/IO2DOPdbZhxNbzuGh/+PCKG/idpmSaPyP9F0veb6KFLXxdL2lr8vdl0b5Ke0uRu3d81eWxjlaQLJG2Q9LakFyTNbVFv/6PJob3f0GSwRhvq7TpN7qK/IWlL8bes6XVX0tdQ1hs/lwWS4AAdkARhB5Ig7EAShB1IgrADSRB2IAnCDiTx/8JVCxhrToRxAAAAAElFTkSuQmCC\n",
      "text/plain": [
       "<Figure size 432x288 with 1 Axes>"
      ]
     },
     "metadata": {
      "needs_background": "light"
     },
     "output_type": "display_data"
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "tensor(7)\n"
     ]
    }
   ],
   "source": [
    "for i, (images, labels) in enumerate(train_dataloader):\n",
    "    print(images.shape, labels.shape)\n",
    "\n",
    "    plt.imshow(images[0][0], cmap='gray')\n",
    "    plt.show()\n",
    "\n",
    "    print(labels[0])\n",
    "    \n",
    "    if i > 10:\n",
    "        break"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "81933b48",
   "metadata": {},
   "source": [
    "### 构建网络"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 6,
   "id": "a66b81f3",
   "metadata": {},
   "outputs": [],
   "source": [
    "import torch.nn as nn\n",
    "\n",
    "class Model(nn.Module):\n",
    "    def __init__(self, input_size, output_size):\n",
    "        super().__init__()\n",
    "        self.linear = nn.Linear(input_size, output_size)\n",
    "    \n",
    "    def forward(self, x):\n",
    "        logits = self.linear(x)\n",
    "        return logits\n"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 7,
   "id": "957dffe9",
   "metadata": {},
   "outputs": [],
   "source": [
    "input_size = 28*28\n",
    "output_size = 10\n",
    "model = Model(input_size, output_size)"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "80fb34da",
   "metadata": {},
   "source": [
    "### 损失函数和优化器"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 8,
   "id": "e3d40f21",
   "metadata": {},
   "outputs": [],
   "source": [
    "criterion = nn.CrossEntropyLoss()\n",
    "optimizer = torch.optim.SGD(model.parameters(), lr=0.01)"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "3ab2faf5",
   "metadata": {},
   "source": [
    "### 模型评估"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 9,
   "id": "04f65f11",
   "metadata": {},
   "outputs": [],
   "source": [
    "def evaluate(model, data_loader):\n",
    "    model.eval()\n",
    "    correct = 0\n",
    "    total = 0\n",
    "    with torch.no_grad():\n",
    "        for x, y in data_loader:\n",
    "            x = x.view(-1, input_size)\n",
    "            logits = model(x)\n",
    "            _, predicted = torch.max(logits.data, 1)\n",
    "            total += y.size(0)\n",
    "            correct += (predicted == y).sum().item()\n",
    "    return correct / total"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "4247397c",
   "metadata": {},
   "source": [
    "### 模型训练"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 10,
   "id": "d5f4c78b",
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Epoch 1: test accuracy = 0.87\n",
      "Epoch 2: test accuracy = 0.88\n",
      "Epoch 3: test accuracy = 0.89\n",
      "Epoch 4: test accuracy = 0.90\n",
      "Epoch 5: test accuracy = 0.90\n",
      "Epoch 6: test accuracy = 0.90\n",
      "Epoch 7: test accuracy = 0.90\n",
      "Epoch 8: test accuracy = 0.91\n",
      "Epoch 9: test accuracy = 0.91\n",
      "Epoch 10: test accuracy = 0.91\n"
     ]
    }
   ],
   "source": [
    "for epoch in range(10):\n",
    "    model.train()\n",
    "    for images, labels in train_dataloader:\n",
    "        # 将图像和标签转换成张量\n",
    "        images = images.view(-1, 28*28)\n",
    "        labels = labels.long()\n",
    "        \n",
    "        # 前向传播\n",
    "        outputs = model(images)\n",
    "        loss = criterion(outputs, labels)\n",
    "        \n",
    "        # 反向传播和优化\n",
    "        optimizer.zero_grad()\n",
    "        loss.backward()\n",
    "        optimizer.step()\n",
    "    accuracy = evaluate(model, test_dataloader)\n",
    "    print(f'Epoch {epoch+1}: test accuracy = {accuracy:.2f}')"
   ]
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 3 (ipykernel)",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.8.10"
  },
  "toc": {
   "base_numbering": 1,
   "nav_menu": {},
   "number_sections": true,
   "sideBar": true,
   "skip_h1_title": false,
   "title_cell": "Table of Contents",
   "title_sidebar": "Contents",
   "toc_cell": false,
   "toc_position": {
    "height": "calc(100% - 180px)",
    "left": "10px",
    "top": "150px",
    "width": "195.458px"
   },
   "toc_section_display": true,
   "toc_window_display": true
  }
 },
 "nbformat": 4,
 "nbformat_minor": 5
}
